﻿<!DOCTYPE HTML>
<html lang="zxx">

<head>
    <title>塞班购物商城登陆页面</title>
    <#assign base=request.contextPath/>
    <!-- Meta tag Keywords -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta charset="UTF-8" />
    <meta name="keywords" content=""/>
    <script>
        addEventListener("load", function () {
            setTimeout(hideURLbar, 0);
        }, false);

        function hideURLbar() {
            window.scrollTo(0, 1);
        }
    </script>
    <!-- Meta tag Keywords -->
    <!-- css files -->
    <link rel="stylesheet" href="${base}/backstage/login/css/style.css" type="text/css" media="all" />
    <!-- Style-CSS -->
    <link rel="stylesheet" href="${base}/backstage/login/css/fontawesome-all.css">
    <!-- Font-Awesome-Icons-CSS -->
    <!-- //css files -->
    <!-- web-fonts -->
<#--    <link href="http://maxcdn.bootstrapcdn.com/css?family=Josefin+Sans:100,100i,300,300i,400,400i,600,600i,700,700i" rel="stylesheet">-->
<#--    <link href="http://maxcdn.bootstrapcdn.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i" rel="stylesheet">-->
    <script type="text/javascript" src="${base}/backstage/denglu/js/jquery.min.js"></script>
    <script>
        var base =  "${base}";
    </script>
    <script src="${base}/backstage/js/ipNameUrl.js"></script>
<#--    <link rel="stylesheet" href="${base}/backstage/layui/css/layui.css">-->
<#--    <link href="${base}/backstage/denglu/css/style.css" rel='stylesheet' type='text/css' />-->
    <!-- //web-fonts -->
</head>

<body>
<!-- bg effect -->
<div id="bg">
    <canvas></canvas>
    <canvas></canvas>
    <canvas></canvas>
</div>
<!-- //bg effect -->
<!-- title -->
<h1>
    SaiBan Shopping
</h1>
<!-- //title -->
<!-- content -->
<div class="sub-main-w3">
    <div id="div1">
        <h2>Login Now
            <i class="fas fa-level-down-alt"></i>
        </h2>
        <div class="form-style-agile" >
            <label>
                <i class="fas fa-user"></i>
                账号
            </label>
            <input placeholder="请输入账号" id="account" style="border-radius: 28px;"  name="Name" type="text" required="">
        </div>
        <div class="form-style-agile">
            <label>
                <i class="fas fa-unlock-alt"></i>
                密码
            </label>
            <input placeholder="请输入密码" id="passWord" style="border-radius: 28px;" name="Password" type="password" required="">
        </div>
        <input type="button" id="login" onclick="login()" value="Go Login">
    </div>
</div>
<!-- //content -->

<!-- copyright -->
<div class="footer">
    <p>Copyright &copy; 2020.塞班购物商城后台管理系统</p>
</div>
<!-- //copyright -->

<!-- Jquery -->
<#--<script src="${base}/backstage/login/js/jquery-3.3.1.min.js"></script>-->
<!-- //Jquery -->

<!-- effect js -->
<script src="${base}/backstage/login/js/canva_moving_effect.js"></script>
<!-- //effect js -->

</body>
<script type="text/javascript" src="${base}/backstage/layui/layui.js"></script>

<script type="text/javascript">

    var form;
    layui.use(['table', 'form', 'layedit', 'laydate'], function () {
        form = layui.form
            , $ = layui.jquery
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate
            , table = layui.table;
    })

    function login() {
        if ($("#account").val() == "" || $("#account").val() == null) {
            layui.layer.msg("请输入账户", {icon: 5})
            return;
        }
        if ($("#passWord").val() == "" || $("#passWord").val() == null) {
            layui.layer.msg("请输入密码", {icon: 5})
            return;
        }
        var index = layer.msg("正在登录....");
        $.ajax({
            type: "POST",
            url: "${base}/admin/userInfo/login",
            data: {
                "account": $("#account").val(),
                "passWord": $("#passWord").val()
            },

            success: function (data) {
                if (data.code === 200) {
                    setTimeout(function(){
                        layer.close(index);
                        window.location.href = "${base}/admin/index/index.html"
                    },1000);

                }else{
                    layui.layer.msg(data.msg, {icon: 5})
                }

            }
        });
    }
    //键盘事件
    $("body").bind("keydown",function(e){
        // 兼容FF和IE和Opera
        var theEvent = e || window.event;
        var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
        if (code == 13) {
            //回车执行查询
            $("#login").click();
        }
    });

</script>

</html>